#!/usr/bin/env bash

start_date="2018-12-01"
end_date="2019-01-07"

while [ "${start_date}" != "${end_date}" ]
do
    echo ${start_date}
    start_date=`date -d "+1 day ${start_date}" +%Y-%m-%d`
done













start_date=20181201
end_date=20181231
start_sec=`date -d "$start_date" "+%s"`
end_sec=`date -d "$end_date" "+%s"`
for((i=start_sec;i<=end_sec;i+=86400)); do
    day=$(date -d "@$i" "+%Y-%m-%d")
    echo $day
done



echo "方法2"
start=20181201
end=20190107
while [ ${start} -le ${end} ]
do
  echo ${start}
  start=`date -d "1 day ${start}" +%Y%m%d`	# 日期自增
done



echo  "333"

start='2018-12-01'
end='2019-01-07'
while [ "${start}" != "${end}" ]
do
  echo ${start}
  start=`date -d "1 day ${start}" +%Y-%m-%d`	# 日期自增
done
